/** 跳转到指定的页面, 压入栈 */
export function navigate(url:string){
    uni.navigateTo({url});
}

/** 跳转到指定的页面, 不压入栈 */
export function redirect(url:string,  duration: number = 300){
    setTimeout(()=>{ uni.redirectTo({ url }) }, duration)
}
/** 关闭所有页面，打开到应用内的某个页面 */
export function reLaunch(url:string, duration: number = 500){
    setTimeout(()=>{ uni.reLaunch({ url }) }, duration)
}

/** 延迟跳转 */
export function navigateTimeout(url:string, duration: number = 500){
    setTimeout(()=>{ navigate(url) }, duration)
}

/** 延迟跳转 */
export function redirectTimeout(url:string, duration: number = 500){
    setTimeout(()=>{ redirect(url) }, duration)
}

/** 延迟跳转 */
export function navigateTo(opt: any,  duration: number = 500){
    setTimeout(()=>{ uni.navigateTo(opt) }, duration)
}

/** 延迟跳转 */
export function redirectTo(opt: any,  duration: number = 500){
    setTimeout(()=>{ uni.redirectTo(opt) }, duration)
}

/** 回退 */
export function goBack(delta: number, duration: number = 100){
    setTimeout(()=>{
        uni.navigateBack({
            delta,
        });
    }, duration)
}